//
//  LoginViewController.m
//  LeanCloudDemo
//
//  Created by CuiFengshuai on 15/11/20.
//  Copyright © 2015年 MK_. All rights reserved.
//

#import "LoginViewController.h"
#import "RegisterViewController.h"
#import "AVUser.h"

@interface LoginViewController ()
@property (weak, nonatomic) IBOutlet UITextField *nameField;
@property (weak, nonatomic) IBOutlet UITextField *passwdField;

@end

@implementation LoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)didClickLogin:(id)sender {
    [AVUser logInWithUsernameInBackground:self.nameField.text password:self.passwdField.text block:^(AVUser *user, NSError *error) {
        if (user != nil) {
            NSLog(@"登录成功");
        } else {
            NSLog(@"登录失败%@", error);
        }
    }];
    
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
